import request from "../index";
import type { ResultData } from "../index";

export interface ISearchData {
  code: number;
  more: boolean;
  products?: any[];
}

export interface ISearchParam {
  limit: number;
  offset: number;
  key: string;
}

export const getSearchData = (param: ISearchParam) => {
  // 分别传入路径，参数，请求头设置
  return request.post<ISearchData>("/store/api/product/search", param, {
    "Content-Type": "application/x-www-form-urlencoded",
  });
};
